package cn.itcast.flink.bean;

/**
 * Author itcast
 * Date 2022/1/17 14:35
 * Desc TODO
 */
public class Animal {
    //属性，类Animal具有的特性，成员变量
    //private protected public 可见性
    // internal final
    private String breath;
    private int legs;
    private boolean island;
    private long height;

    /**
     * 全参构造 带上所有的成员变量的构造方法
     * @param breath
     * @param legs
     * @param island
     * @param height
     */
    public Animal(String breath, int legs, boolean island, long height) {
        this.breath = breath;
        this.legs = legs;
        this.island = island;
        this.height = height;
    }

    /**
     * 无参构造方法
     */
    public Animal(){
        this("有",2,false,8);
    }

    public static void main(String[] args) {
        Animal littleCjl = new Animal("有", 4, true, 2);
        Animal animal2 = new Animal("有", 4, true, 7);

        Animal animal3 = new Animal();
    }

    public void eat(){
        System.out.println("eat grass！");
    }

}
